package test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class HSQLDBConnection {
	public static void connect() {
		try {
	        Class.forName("org.hsqldb.jdbcDriver" );
	    } catch (Exception e) {
	        System.err.println("ERROR: failed to load HSQLDB JDBC driver.");
	        e.printStackTrace();
	        return;
	    }

	    Connection c = null;
	    
	    try {
			c = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/cantreesdb", "sa", "12");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			if (c != null) {
				try { c.close(); } catch (SQLException e) {}
				c = null; 
			}
		}
	}
	
	public static void main(String[] args) {
		HSQLDBConnection.connect();
		System.out.println("end");
	}
}
